<?php
	// session_set_cookie_params(3600 * 24 * 7); // one week session
	session_start();

	// function user_logged_in() {
	// 	return isset($_SESSION['user_id']);
	// }
	// function recruiter_logged_in() {
	// 	return isset($_SESSION['recruiter_id']);
	// }
	// function gover_logged_in() {
	// 	return isset($_SESSION['gover_id']);
	// }
	// function seeker_logged_in() {
	// 	return isset($_SESSION['seeker_id']);
	// }
	function staff_logged_in() {
		return isset($_SESSION['staff_id']);
	}
	function admin_logged_in() {
		return isset($_SESSION['admin_id']);
	}
	
	function confirm_staff_logged_in() {
		if (!staff_logged_in()) {
			$_SESSION['request_from'] = $_SERVER['REQUEST_URI'];
			redirect_to("login");
		}
	}
	function confirm_admin_logged_in() {
		if (!admin_logged_in()) {
			$_SESSION['request_from'] = $_SERVER['REQUEST_URI'];
			redirect_to("login");
		}
	}

	// function confirm_user_logged_in() {
	// 	if (!user_logged_in()) {
	// 		$_SESSION['request_from'] = $_SERVER['REQUEST_URI'];
	// 		redirect_to("/login");
	// 	}
	// }
	// function confirm_recruiter_logged_in() {
	// 	if (!recruiter_logged_in()) {
	// 		$_SESSION['request_from'] = $_SERVER['REQUEST_URI'];
	// 		$_SESSION['recruiter_require'] = 1;
	// 		redirect_to("/login");
	// 	}
	// }
	// function confirm_seeker_logged_in() {
	// 	if (!seeker_logged_in()) {
	// 		$_SESSION['request_from'] = $_SERVER['REQUEST_URI'];
	// 		$_SESSION['seeker_require'] = 1;
	// 		redirect_to("/login");
	// 	}
	// }
?>